package com.sky.controller.user;

import com.sky.dto.OrdersSubmitDTO;
import com.sky.result.Result;
import com.sky.service.OrderService;
import com.sky.vo.OrderSubmitVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: OrderController
 * Package: com.sky.controller.user
 * Description:
 *
 * @Author JJQ
 * @create 2024/5/21 0021 19:28
 * @Version 1.0
 */
@RestController("userOrderController")
@RequestMapping("/user/order")
@Api(tags = "订单接口")
public class OrderController {

    @Autowired
    OrderService orderService;

    @PostMapping("/create")
    @ApiOperation("创建订单")
    public Result<OrderSubmitVO> createOrder (@RequestBody OrdersSubmitDTO submitDTO) {
        OrderSubmitVO orderSubmitVO = orderService.create(submitDTO);
        return Result.success(orderSubmitVO);
    }
}
